package edu.friday;

import edu.friday.model.User;
import edu.friday.repository.UserRepository;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class JUnit {
    @Autowired
    private UserRepository userRepository;

    @Test
    public void testSaveMethod() {
        // 1. 构造测试数据
        User user = new User();
        user.setUsername("testUser");
        user.setPassword("testPass");

        user.setNumber(123456);
        user.setDelFlag(0);
        // 2. 执行 save 操作
        User savedUser = userRepository.save(user);

        System.out.println(savedUser.getUsername());
    }
}
